arm-trusted-firmware-mediatek: add MT7987 DDR4 4BG images
authorChukun Pan <[email protected]>
Mon, 10 Nov 2025 10:16:30 +0000 (18:16 +0800)
committerHauke Mehrtens <[email protected]>
Wed, 10 Dec 2025 23:00:51 +0000 (00:00 +0100)
Add the DDR4_4BG_MODE option, which supports 4GB DDR4 RAM
for the MT7987 and 8GB DDR4 RAM for the MT7988. If this mode
is not enabled, bl2 can only recognize half the size of RAM.

Signed-off-by: Chukun Pan <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/21000
Signed-off-by: Hauke Mehrtens <[email protected]>
package/boot/arm-trusted-firmware-mediatek/Makefile

index f90915ed679001691035268427e16b7489a8c4e8..24fa97e5ce7113797135b1795bc287da8d869793 100644 (file)
@@ -30,6 +30,7 @@ define Trusted-Firmware-A/Default
   BOOT_DEVICE:=
   DDR3_FLYBY:=
   DDR3_FREQ_1866:=
+  DDR4_4BG_MODE:=
   DDR_TYPE:=
   NAND_TYPE:=
   BOARD_QFN:=
@@ -410,6 +411,14 @@ define Trusted-Firmware-A/mt7987-emmc-comb
   DRAM_USE_COMB:=1
 endef
 
+define Trusted-Firmware-A/mt7987-emmc-ddr4-4bg
+  NAME:=MediaTek MT7987 (eMMC, DDR4 4GB)
+  BOOT_DEVICE:=emmc
+  BUILD_SUBTARGET:=filogic
+  PLAT:=mt7987
+  DDR4_4BG_MODE:=1
+endef
+
 define Trusted-Firmware-A/mt7987-nor-comb
   NAME:=MediaTek MT7987 (NOR)
   BOOT_DEVICE:=nor
@@ -426,6 +435,14 @@ define Trusted-Firmware-A/mt7987-sdmmc-comb
   DRAM_USE_COMB:=1
 endef
 
+define Trusted-Firmware-A/mt7987-sdmmc-ddr4-4bg
+  NAME:=MediaTek MT7987 (SD card, DDR4 4GB)
+  BOOT_DEVICE:=sdmmc
+  BUILD_SUBTARGET:=filogic
+  PLAT:=mt7987
+  DDR4_4BG_MODE:=1
+endef
+
 define Trusted-Firmware-A/mt7987-spim-nand0-ubi-comb
   NAME:=MediaTek MT7987 (SPI-NAND via SPIM, UBI)
   BOOT_DEVICE:=spim-nand
@@ -670,8 +687,10 @@ TFA_TARGETS:= \
        mt7986-spim-nand-ubi-ddr4 \
        mt7986-spim-nand-4k-ddr4 \
        mt7987-emmc-comb \
+       mt7987-emmc-ddr4-4bg \
        mt7987-nor-comb \
        mt7987-sdmmc-comb \
+       mt7987-sdmmc-ddr4-4bg \
        mt7987-spim-nand0-ubi-comb \
        mt7987-spim-nand2-ubi-comb \
        mt7987-ram-comb \
@@ -705,6 +724,7 @@ TFA_MAKE_FLAGS += \
        HAVE_DRAM_OBJ_FILE=yes \
        $(if $(DDR3_FLYBY),DDR3_FLYBY=1) \
        $(if $(DDR3_FREQ_1866),DDR3_FREQ_1866=1) \
+       $(if $(DDR4_4BG_MODE),DDR4_4BG_MODE=1) \
        $(if $(DRAM_USE_COMB),DRAM_USE_COMB=1) \
        $(if $(RAM_BOOT_UART_DL),RAM_BOOT_UART_DL=1) \
        $(if $(USE_UBI),UBI=1 $(if $(findstring mt7622,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x80000)) \